package cn.moukou.dictator.controller;

import cn.moukou.dictator.util.Resp;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/dictator/api")
public class HelloController {
    @GetMapping("/ping")
    public Resp<String> getPing() {
        return Resp.ok("ping");
    }

    @PostMapping("/ping")
    public Resp<String> postPing(@RequestBody Map<String,Object> params) {
        String name = (String) params.get("name");
        return Resp.ok(name);
    }
}
